# 学生对象保存单个学生信息
class Student():
    def __init__(self,data):
        self.name,self.sex,self.age,self.height=data.split(',')



if __name__ == '__main__':
    # 获取学生信息
    with open('students.csv','r',encoding='gbk') as f:
        l=[]
        infos=f.readlines()[1:]
        for info in infos:
            l.append(Student(info))

    # 打印结果
    print('学生平均身高为:{}'.format(sum([int(i.height) for i in l])/len(l)))
    print('学生平均年龄为:{}'.format(sum([int(i.age) for i in l]) / len(l)))
    print('年龄大于10的学生:{}'.format([i.name for i in l if int(i.age)>10]))